@extends('back.index')
@section('title','作家咨询管理-后台管理系统')
@section('mian')
    <div style="font-size:14px;padding:20px;" class="modal-content">
        <a class="btn btn-primary book_back" href="{{url('back/writer/userList')}}">返回</a>
        <h2 class="sub-header power_mian">的作品管理</h2>
        <div class="table-responsive">
            <table class="table table-striped">
            <tr>
                <th>书名</th>
                <th>封面</th>
                <th>类型</th>
                <th>章节数</th>
                <th>添加时间</th>
                <th>更新时间</th>
                <th>操作</th>
            </tr>
            @if(count($new))
                @foreach($new as $k)
                <tr>
                <td>{{$k->bookname}}</td>
                <td>
                    <img src="{{asset('/image/books/'.$k->bookicon)}}" alt="" style="width:100px;height:100px">
                </td>
                <td>
                    @if($k->cid == 1)
                        玄幻
                    @elseif($k->cid == 2)
                        科幻
                    @elseif($k->cid == 3)
                        都市
                    @elseif($k->cid == 4)
                        军事
                    @elseif($k->cid == 5)
                        末日
                    @elseif($k->cid == 6)
                        武侠
                    @elseif($k->cid == 7)
                        爱情
                    @endif
                </td>
                <td>{{$k->chapterssum}}</td>
                <td>{{date('Y-m-d H:i:s',$k->addtime)}}</td>
                <td>
                    @if($k->uptime)
                        {{date('Y-m-d H:i:s',$k->uptime)}}
                        @else
                        暂无更新
                    @endif
                </td>
                <td>
                    <a href="{{url('back/writer/book_txt/'.$k->id)}}" class="btn btn-info">查看章节</a>
                    &nbsp;
                    <a href="{{url('back/writer/myBook/desc/'.$k->id)}}" class="btn btn-info">按更新排序</a>
                    &nbsp;
                    <a href="{{url('back/writer/myBook/del/'.$k->id)}}" class="btn btn-info">删除</a>
                </td>
                </tr>
                @endforeach
                @else
                <tr>
                    <td colspan="8" style="text-align: center;border-bottom: 1px solid #DDD"><h2>他暂时还没有发表作品哦</h2></td>
                </tr>
            @endif
            </table>
            {{$new->links()}}
        </div>
    </div>
@endsection